<!--
  Generated template for the ChatViewPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar color="primary">
    <ion-title>{{targetUser.userName}}</ion-title>
  </ion-navbar>
</ion-header>
<ion-content>
  <ion-grid *ngFor="let item of chatLog">
    <ion-row style="padding: 0;text-align: center">
      <ion-col col-12>
        {{item.updatedAt}}
      </ion-col>
    </ion-row>
    <ion-row *ngIf="item.idUser!=user.id">
      <ion-col col-2>
        <img (click)="goChatView()" src="assets/img/avatar-frodo.jpg" style="border-radius: 50%">
      </ion-col>
      <ion-col col-8 class="targetCart">
        <ion-card >
          <ion-card-content>
            {{item.logContent}}
          </ion-card-content>
        </ion-card>
      </ion-col>
      <ion-col col-2>
      </ion-col>
    </ion-row>
    <ion-row *ngIf="item.idUser==user.id">
      <ion-col col-2>
      </ion-col>
      <ion-col col-8 class="myCart">
        <ion-card>
          <ion-card-content style="background-color: #f4f4f4">
            {{item.logContent}}
          </ion-card-content>
        </ion-card>
      </ion-col>
      <ion-col col-2>
        <img src="assets/img/avatar-frodo.jpg" style="border-radius: 50%">
      </ion-col>
    </ion-row>
  </ion-grid>
</ion-content>
<ion-footer>
  <ion-toolbar>
    <ion-item>
      <ion-textarea type="text" [(ngModel)]="contentText"></ion-textarea>
    </ion-item>
    <ion-buttons end>
      <button ion-button outline color="primary" (click)="toSendMsg()">
        发送
      </button>
    </ion-buttons>
  </ion-toolbar>
</ion-footer>

